Skip to content

fix(files): Fix FileInfo['path'] situation#58827

Merged
come-nc merged 2 commits intomasterfrom
fix/fix-fileinfo-path
Mar 10, 2026
Merged

fix(files): Fix FileInfo['path'] situation#58827
come-nc merged 2 commits intomasterfrom
fix/fix-fileinfo-path

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Mar 10, 2026

Summary

Previously $fileInfo->getPath() and $fileInfo['path'] would return different things. The [] version was not consistent, being sometimes relative and sometimes kind of absolute, and sometimes plenty wrong (like when used from occ commands, because there is no user in session).
So this is always returning absolute now.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Previously $fileInfo->getPath() and $fileInfo['path'] would return
 different things. The [] version was not consistent, being sometimes
 relative and sometimes kind of absolute, and sometimes plenty wrong
 (like when used from occ commands, because there is no user in
 session).
So this is always returning absolute now.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added this to the Nextcloud 34 milestone Mar 10, 2026
@come-nc come-nc self-assigned this Mar 10, 2026
@come-nc come-nc requested a review from a team as a code owner March 10, 2026 11:00
@come-nc come-nc added the 3. to review Waiting for reviews label Mar 10, 2026
@come-nc come-nc requested review from leftybournes and nfebe and removed request for a team March 10, 2026 11:00
@come-nc
Copy link
Contributor Author

come-nc commented Mar 10, 2026

					$path = $mountPoint . $result['path'];
					$result['path'] = substr($mountPoint . $result['path'], $rootLength);

So there is this version in View::searchCommon, which at least is explicit about what it does. Here ['path'] is relative to the fake root of the view. We could also normalize to that if it fits better.
But as that feels highly related to how View is working and we’re moving to Node API I would feel better to keep ['path'] in sync with getPath.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc requested a review from icewind1991 March 10, 2026 13:41
@come-nc come-nc merged commit c98244a into master Mar 10, 2026
232 of 244 checks passed
@come-nc come-nc deleted the fix/fix-fileinfo-path branch March 10, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants